package com.foldingleaf.recharge.service.impl;

import java.util.List;
import com.foldingleaf.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.foldingleaf.recharge.mapper.AlipayRechargeOrderMapper;
import com.foldingleaf.recharge.domain.AlipayRechargeOrder;
import com.foldingleaf.recharge.service.IAlipayRechargeOrderService;

/**
 * 支付宝充值订单Service业务层处理
 * 
 * @author ajian
 * @date 2022-06-17
 */
@Service
public class AlipayRechargeOrderServiceImpl implements IAlipayRechargeOrderService 
{
    @Autowired
    private AlipayRechargeOrderMapper alipayRechargeOrderMapper;

    /**
     * 查询支付宝充值订单
     * 
     * @param orderId 支付宝充值订单主键
     * @return 支付宝充值订单
     */
    @Override
    public AlipayRechargeOrder selectAlipayRechargeOrderByOrderId(Long orderId)
    {
        return alipayRechargeOrderMapper.selectAlipayRechargeOrderByOrderId(orderId);
    }

    /**
     * 查询支付宝充值订单列表
     * 
     * @param alipayRechargeOrder 支付宝充值订单
     * @return 支付宝充值订单
     */
    @Override
    public List<AlipayRechargeOrder> selectAlipayRechargeOrderList(AlipayRechargeOrder alipayRechargeOrder)
    {
        return alipayRechargeOrderMapper.selectAlipayRechargeOrderList(alipayRechargeOrder);
    }

    /**
     * 新增支付宝充值订单
     * 
     * @param alipayRechargeOrder 支付宝充值订单
     * @return 结果
     */
    @Override
    public int insertAlipayRechargeOrder(AlipayRechargeOrder alipayRechargeOrder)
    {
        alipayRechargeOrder.setCreateTime(DateUtils.getNowDate());
        return alipayRechargeOrderMapper.insertAlipayRechargeOrder(alipayRechargeOrder);
    }

    /**
     * 修改支付宝充值订单
     * 
     * @param alipayRechargeOrder 支付宝充值订单
     * @return 结果
     */
    @Override
    public int updateAlipayRechargeOrder(AlipayRechargeOrder alipayRechargeOrder)
    {
        return alipayRechargeOrderMapper.updateAlipayRechargeOrder(alipayRechargeOrder);
    }

    /**
     * 批量删除支付宝充值订单
     * 
     * @param orderIds 需要删除的支付宝充值订单主键
     * @return 结果
     */
    @Override
    public int deleteAlipayRechargeOrderByOrderIds(Long[] orderIds)
    {
        return alipayRechargeOrderMapper.deleteAlipayRechargeOrderByOrderIds(orderIds);
    }

    /**
     * 删除支付宝充值订单信息
     * 
     * @param orderId 支付宝充值订单主键
     * @return 结果
     */
    @Override
    public int deleteAlipayRechargeOrderByOrderId(Long orderId)
    {
        return alipayRechargeOrderMapper.deleteAlipayRechargeOrderByOrderId(orderId);
    }
}
